package com.feng.common.api;

/**
 * @author Feng
 * @since 2021/10/24 12:45
 */
public enum  ResultCode {

    SUCCESS(200, "操作成功"),
    ERROR(500, "操作异常"),
    BAD_REQUEST(400, "请求异常"),
    PARAM_NOT_MATCH(400, "参数不匹配"),
    FORBIDDEN(403, "权限不足"),
    REQUEST_NOT_FOUND(404, "无此请求"),
    HTTP_BAD_METHOD(405, "请求方式不支持"),
    UNAUTHORIZED(401, "未登录或token无效"),
    USERNAME_PWD_ERROR(501, "用户名或密码错误"),
    USER_NOT_ENABLE(502, "该用户已被禁用");

    private final Integer code;
    private final String msg;

    ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
